use "all_recoded.dta"
*change to your working directory


*on election confidence (H1)
*Predict observed as a function of all pre-treatment covariates and the treatment indicator
logit observed  factchecks college4yrdegreeorabove age5cat male pid7recoded ideo5recoded nonwhite  battlegroundstates
predict observed_hat

*Generate weights
gen wt=1/observed_hat

*Re-run the analysis with weights
regress electionconfidenceindex factchecks college4yrdegreeorabove age5cat male pid7recoded ideo5recoded nonwhite battlegroundstates  [aw=wt]

outreg2 using "h1_attrition.tex", tex replace ctitle(Model 1) label
